<template>
   <div class="mynew">
       <div class="newtop">
           <div class="new-top-l">
               <span>每日上新</span>
           </div>
           <div class="new-top-r" @click="jumpTo">
               <span>更多</span>
               <i class="bi bi-chevron-compact-right"></i>
           </div>
       </div>
       <div class="new-detail">
           <ul>
               <li v-for="item in home.newList" 
               v-bind:key="item.id">
                   <a href="#">
                       <div class="detail-img">
                           <img :src="item.path" alt="">
                       </div>
                       <div class="detail-price">
                           <!-- <span>￥</span> -->
                           <span>{{item.text}}</span>
                       </div>
                   </a>
               </li>
           </ul>
       </div>
   </div>
</template>

<script>
import {mapState} from 'vuex'

export default {
    computed :{
        ...mapState(['home'])
    },
    methods:{
        jumpTo(){
            this.$router.push({path:"/product"});
        }
    }
}
</script>

<style lang="less">
.mynew{
    width: 365px;
    height: 170px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 10px;
    margin-left: 5px;
    margin-right: 10px;
}
.newtop{
    width: 100%;
    height: 35px;
    line-height: 35px;
    display: flex;
    justify-content: space-between;
    .new-top-l{
    width: 25%;
    font-size: 18px;
    margin-left: 20px;
    }
    .new-top-r{
        width: 16%;
        font-size: 14px;
        line-height: 38px;
        color: #706C61;
        i{
            font-weight: bold;
        }
    }
}
.new-detail{
    width: 100%;
    ul{
        width: 100%;
        overflow: auto;
        // overflow-x: scroll;
        display: flex;
        li{
            width: 76px;
            height: 120px;
            // line-height: 30px;
            margin-left: 12px;
        }
    }
}
.detail-img{
    width: 80px;
    height: 80px;
    margin-top: 10px;
    img{
        width: 100%;
        height: 100%;
        display: block;
    }
}
.detail-price{
    text-align: center;
    color: #ad00e6;
    span{
        // &:first-child{
        //     font-size: 14px;
        // }
        // &:last-child{
        //     font-size: 20px;
        // }
        font-size: 14px;
    }
}
</style>